package lumis.service.portalmanagement.cluster;

import java.util.Collections;
import java.util.List;

import lumis.doui.source.AbstractObjectDataProvider;
import lumis.doui.source.TabularSource;
import lumis.portal.PortalException;
import lumis.portal.authentication.SessionConfig;
import lumis.portal.cluster.IClusterConfig;
import lumis.portal.cluster.IClusterManager;
import lumis.portal.manager.ManagerFactory;
import lumis.util.ITransaction;

/**
 * Provides the cluster configuration data.
 * 
 * @see IClusterManager#getClusterConfig(ITransaction)
 * @see IClusterConfig
 * @version $Revision: 8618 $ $Date: 2007-12-18 11:34:20 -0200 (Tue, 18 Dec 2007) $
 * @since 4.1.0
 */
public class ClusterConfigDataProvider extends AbstractObjectDataProvider<TabularSource, IClusterConfig>
{
	public ClusterConfigDataProvider()
	{
		super(IClusterConfig.class);
	}

	@Override
	protected List<IClusterConfig> loadObjects(SessionConfig sessionConfig, TabularSource source, ITransaction transaction) throws PortalException
	{
		IClusterConfig clusterConfig = ManagerFactory.getClusterManager().getClusterConfig(transaction);
		return Collections.singletonList(clusterConfig);
	}
}
